$(function () {
    const $iptPhone     = $("#ipt-find-phone");   // 要查找的
    const $labelFind    = $("#label-find-phone"); //

    const $name          = $("#ipt-name");       // 查找到的内容
    const $passwd        = $("#ipt-passwd");     //
    const $email         = $("#ipt-email");      //
    const $phone         = $("#ipt-phone");      //
    const $idNumber      = $("#ipt-idNumber");   //
    const $dispatches    = $("#ipt-disp");       //
    const $status        = $("#status");         //
    const $regtime       = $("#ipt-regtime");    //
    const $logintime     = $("#ipt-logintime");  //
    const $addr          = $("#addr");           //

    const $labelName        = $("#label-name");     // 标签
    const $labelPasswd      = $("#label-passwd");   //
    const $labelEmail       = $("#label-email");    //
    const $labelPhone       = $("#label-phone");    //
    const $labelIdNumber    = $("#label-idNumber"); //
    const $labelDisp        = $("#label-disp");     //
    const $labelAddr        = $("#label-addr");     //

    const $find           = $("#find");       // 按钮
    const $submit         = $("#submit");     //
    const $reset          = $("#reset");      //
    const $res = $("#res");
    const doc = {
        $iptPhone:$iptPhone,
        $labelFind:$labelFind,
        $name:$name,
        $passwd:$passwd,
        $email:$email,
        $phone:$phone,
        $idNumber:$idNumber,
        $dispatches:$dispatches,
        $status_0:null,
        $status_2:null,
        $status:$status,
        $regtime:$regtime,
        $logintime:$logintime,
        $addr:$addr,
        $labelName:$labelName,
        $labelPasswd:$labelPasswd,
        $labelEmail:$labelEmail,
        $labelPhone:$labelPhone,
        $labelIdNumber:$labelIdNumber,
        $labelDisp:$labelDisp,
        $labelAddr:$labelAddr,
        $find:$find,
        $submit:$submit,
        $reset:$reset,
        $res:$res
    }
    findCourier(doc);
    showTips(null, $passwd);
    $submit.click(function() {
        let windowId = layer.load();
        $.getJSON("/admin/views/courier/delete.do", {id: json.id}, function (data) {
            layer.close(windowId);
            layer.msg(data.message);
            if (data.status === 0) {
                json.waitingForSamePhone = false;
                $("input").val('');
                $res.hide();
            } else if (data.status === -404) {
                location.assign('/login.html');
            }
        });
        return false;
    });
});